home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
system
/
pc_dcl.zip
/
HELP
/
LEXICALS.HTX
< prev
next >
Wrap
Text File
|
1992-01-08
|
45KB
|
1,488 lines
Lexicals
Lexicals
A set of functions that return information about character strings
and attributes of the current process.
Additional information available:
F$CVTIMEF$CVTIME F$DIRECTORYF$DIRECTORY F$EDITF$EDIT F$ELEMENTF$ELEMENT F$ENVIRONMENTF$ENVIRONMENT
F$EXTRACTF$EXTRACT F$FILE_ATTRIBUTESF$FILE_ATTRIBUTES F$GETDVIF$GETDVI F$GETSYIF$GETSYI F$LENGTHF$LENGTH
F$LOCATEF$LOCATE F$MESSAGEF$MESSAGE F$SEARCHF$SEARCH F$MODEF$MODE F$TIMEF$TIME F$TRNLNMF$TRNLNM
F$TYPEF$TYPE F$USERF$USER F$VERIFYF$VERIFY
F$CVTIME
F$CVTIME
Converts an absolute or a combination time string to a string of the
form "yyyy-mm-dd hh:mm:ss.cc". The F$CVTIME function can also return
information about an absolute, combination, or delta time string.
Format:
F$CVTIME([input_time] [,output_time] [,field])
Additional information available:
Return_ValueF$CVTIME.Return_Value Input_timeF$CVTIME.Return_Value Output_timeF$CVTIME.Output_time FieldF$CVTIME.Field
ExamplesF$CVTIME.Examples
F$CVTIME.Return_Value
F$CVTIME
Return_Value
A character string containing the requested information.
F$CVTIME
input_time
The time string for which information is requested. Specify the
input time string as a character string expression. You can specify
the input time string as an absolute, combination or delta time. If
you omit the time argument or if you specify the time as a null
string, the current date and time, in absolute time format, is used.
F$CVTIME.Output_time
F$CVTIME
output_time
The time format for the information you want returned. Specify the
output item argument as a character string expression that equates to
one of the following strings: ABSOLUTE The requested information
should be returned in absolute time format "dd-mmm-yyyy hh:mm:ss.cc".
COMPARISON The requested information should be returned in the form
"yyyy-mm-dd hh:mm:ss.cc".
ABSOLUTE The requested information should be returned in absolute
time format.
COMPARISON The requested information should be returned in the form
"yyyy-mm-dd hh:mm:ss.cc".
If you omit the output time argument, the default is COMPARISON.
F$CVTIME.Field
F$CVTIME
field
The type of information to be returned. The information is returned
in the time format specified by the output time argument.
Specify the field argument as a character string expression that
evaluates to one of the following strings:
DATE The date field is returned.
DATETIME The entire date and time string is returned.
DAY The day field is returned.
HOUR The hour field is returned.
HUNDREDTH The hundredth of a second field is returned.
MINUTE The minute field is returned.
MONTH The month field is returned. You cannot specify MONTH if
you also specify a delta input time and the DELTA output
time argument.
SECOND The second field is returned.
TIME The time field is returned.
WEEKDAY The weekday that corresponds with the input time argument
is returned. You cannot specify WEEKDAY if you also
specify a delta input time and the DELTA output time
argument. When the weekday is returned, the first letter
is in uppercase, and the following letters are in
lowercase.
YEAR The year field is returned. You cannot specify YEAR if
you also specify a delta input time and the DELTA output
time argument.
If you do not specify a field argument, the default is DATETIME.
F$CVTIME.Examples
F$CVTIME
Examples
1. $ TIME = F$TIME()
$ SHOW SYMBOL TIME
TIME = "15-APR-1989 10:56:23.10"
$ TIME = F$CVTIME(TIME)
$ SHOW SYMBOL TIME
TIME = "1989-04-15 10:56:23.10"
This example uses the F$TIME function to return the system time as a
character string, and to assign the time to the symbol TIME. Then
the F$CVTIME function is used to convert the system time to an
alternate time format. Note that you do not need to place quotation
marks around the argument TIME because it is a symbol. Symbols are
automatically evaluated when they are used as arguments for lexical
functions.
You can use the resultant string to compare two dates (using .LTS.
and .GTS. operators). For example, you can use F$CVTIME to convert
two time strings and store the results in the symbols TIME_1 and
TIME_2. You can compare the two values, and branch to a label, based
on the results as shown below:
$ IF TIME_1 .LTS. TIME_2 THEN GOTO FIRST
2. $ NEXT = F$CVTIME("TOMORROW",,"WEEKDAY")
$ SHOW SYMBOL NEXT
NEXT = "Tuesday"
In this example, the F$CVTIME returns the weekday that corresponds to
the absolute time keyword "TOMORROW". You must enclose the arguments
"TOMORROW" and "WEEKDAY" in quotation marks because they are
character string expressions. Also, you must include a comma as a
placeholder for the output time argument that is omitted.
F$DIRECTORY
F$DIRECTORY
Returns the current default directory name string. The F$DIRECTORY
function has no arguments but must be followed by parentheses.
Format:
F$DIRECTORY()
Additional information available:
Return_ValueF$DIRECTORY.Return_Value ExampleF$DIRECTORY.Example
F$DIRECTORY.Return_Value
F$DIRECTORY
Return_Value
A character string for the current default directory name, including
square brackets ([]). If you use the SET DEFAULT command and specify
angle brackets (<>) in a directory specification, the F$DIRECTORY
function returns angle brackets in the directory string.
F$DIRECTORY.Example
F$DIRECTORY
example
1. $ SAVE_DIR = F$DIRECTORY()
$ SET DEFAULT [MALCOLM.TESTFILES]
.
.
.
$ SET DEFAULT 'SAVE_DIR'
This example shows an excerpt from a command procedure that uses the
F$DIRECTORY function to save the current default directory setting.
The assignment statement equates the symbol SAVE_DIR to the current
directory. Then the SET DEFAULT command establishes a new default
directory. Later, the symbol SAVE_DIR is used in the SET DEFAULT
command that restores the original default directory.
F$EDIT
F$EDIT
Edits a string expression based on the edits specified in the
edit-list.
Format:
F$EDIT(string, edit-keyword)
Additional information available:
Return_ValueF$EDIT.Return_Value StringF$EDIT.Return_Value Edit_keywordF$EDIT.Edit_keyword
ExamplesF$EDIT.Examples
F$EDIT.Return_Value
F$EDIT
Return_Value
A character string containing the specified edits.
F$EDIT
string
A string to be edited. Specify the string argument as a character
string expression.
F$EDIT.Edit_keyword
F$EDIT
edit_keyword
A keyword that specify the types of edits to be made to the string.
You cannot abbreviate these keywords.
Specify the edit_keyword argument as a character string expression.